import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/layout/index.vue'

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/Dashboard.vue'),
        meta: { title: '仪表盘', icon: 'dashboard' }
      },
      {
        path: 'process-definition',
        name: 'ProcessDefinition',
        component: () => import('@/views/ProcessDefinition.vue'),
        meta: { title: '流程定义', icon: 'document' }
      },
      {
        path: 'process-instance',
        name: 'ProcessInstance',
        component: () => import('@/views/ProcessInstance.vue'),
        meta: { title: '流程实例', icon: 'operation' }
      },
      {
        path: 'task',
        name: 'Task',
        component: () => import('@/views/Task.vue'),
        meta: { title: '任务管理', icon: 'list' }
      },
      {
        path: 'bpmn-editor',
        name: 'BpmnEditor',
        component: () => import('@/views/BpmnEditor.vue'),
        meta: { title: 'BPMN 编辑器', icon: 'edit' }
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 